HAL GFXMMU migration: List of applicable concepts

This section provides information about the HAL GFXMMU applicable architecture concepts.

Concepts for GFXMMU

Concept

Description

Separation of initialization and configuration functions

The initialization has been split into separate init and config functions:

  • HAL_GFXMMU_Init: Initializes the handle and links it to a GFXMMU instance.

  • HAL_GFXMMU_SetConfig: Sets the number of blocks per line or the number of bytes per line.

Removal and conversion of init structure to configuration structure

The init structure has been removed and moved into HAL_GFXMMU_SetConfig function.

Renaming of the handle structure

The handle structure has been renamed to hal_gfxmmu_handle_t.

Renaming unitary init structures

The structure GFXMMU_InitTypeDef is no longer available . It has been replaced by hal_gfxmmu_config_t.

Remove MspInit and MspDeInit callbacks

HAL_GFXMMU_MspInit and HAL_GFXMMU_MspDeInit are no longer available have been replaced by a user sequence to initializes and configures the GFXMMU.

Unitary configuration APIs

New APIs are available to get and set GFXMMU features.

Introduction of HAL user data set/get APIs

Two functions to set and get user data are available: HAL_GFXMMU_SetUserData``and ``HAL_GFXMMU_GetUserData.

Individual callback registration APIs replace global register and unregister functions

The callback registration is handled by specific functions for each GFXMMU event. These functions are used to register callback functions for different GFXMMU events.

Removal of hardware-related macros in HAL2

All hardware macros have been removed from the HAL GFXMMU driver, and equivalent services are ensured through the LL APIs.

Revised and optimized HAL state machine

The GFXMMU state machine is reworked to ensure transitions of the peripheral functional states. The GFXMMU is managed by three state machines:

  1. Global state machine

  2. Buffer state machine

  3. LUT state machine

Revised and optimized HAL API status returns

The HAL GFXMMU functions were updated to return:

  • HAL_INVALID_PARAM: in case of a NULL p_config structure pointer.

  • HAL_ERROR: in case of an error.

  • HAL_OK: in case of a successfully completed operation.

Revised and optimized HAL error management

Redesign the error handling mechanisms within the HAL to enhance the detection, reporting, and management of errors.

Replaced TypeDef suffix with _t in type names

All TypeDef parts of the HAL GFXMMU driver have been removed and replaced by _t.

Replaced nonmodifiable pointers with const keywords

Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable.

Assertion implementation and usage in HAL1

Parameters and states are checked using ASSERT_DBG_STATE and ASSERT_DBG_PARAM macros.

Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.

Finite parameters (including GFXMMU instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety.

Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).

All HAL GFXMMU functions start with HAL_GFXMMU. All HAL GFXMMU enum and struct start with hal_gfxmmu.